<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Design by Free CSS Templates
http://www.freecsstemplates.org
Released for free under a Creative Commons Attribution 2.5 License
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>CSC560 Design and Analysis of Real-Time Systems</title>
<meta name="keywords" content="CSC560" />
<meta name="description" content="CSC560" />
<link href="../default.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="wrapper">
	<div id="header">
		<h1>CSC560</h1>
		<h2>Design and Analysis of Real-Time Systems</h2>
		<ul>
			<li class="first"> <a href="../index.html" accesskey="1" title="">Home</a> </li>
			<li> <a href="../project1/index.html" accesskey="2" title="">Project 1</a>	</li>
			<li> <a href="../project2/index.html" accesskey="3" title="">Project 2</a> </li>
			<li> <a href="../project3/index.html" accesskey="4" title="">Project 3</a> </li>
			<li> <a href="index.html" accesskey="4" title=""><b>Project 4</b></a> </li>
			<li> <a href="../project5/index.html" accesskey="4" title="">Project 5</a> </li>
		</ul>
	</div>
</div>
<div id="content">
	<div id="colOne">
		<h2>Timing Diagram</h2>
		<p>
			Real time is not real fast. Too fast of processing is a waste of CPU cycles, while too slow of processing 
			results in irresponsive system. Therefore, timeliness, not the processing speed, ultimately determines the correctness of a real time system.

			In our current design, Cat is the most autonomous and most complex. Thus, we use the Timing Diagram 
			of Cat to illustrate the core timing requirement of our application. 			
		</p>
		<p>
			<h3>Cat</h3>
			There are five tasks scheduled in Cat: Sensor, Searching, Chasing, Rx, & Tx
			<br><br>
			<h3>Sensor (Periodic task)</h3>
			Sensor task polls IR beacon status to determine whether the Mouse is detected and in which of the four 
			directions. The direction is determined by which beacon pin value is polling low.  It’s similar to 
			polling joystick positions as in Project 2. Sensor task must execute frequently enough so that it 
			does not miss the polling low of a beacon pin. Sensor task must not execute too frequently neither 
			that it consumes most of the CPU cycles. In addition, from the experience gained in Project 1 and 2, 
			we determine that the Roomba shall optimally execute 4 SCI commands per second. Thus, we decide to 
			execute Sensor task periodically every 250 milliseconds and it shall result in a responsive Cat roomba 
			and leave enough time for other tasks to execute.		
			<br><br>
			<h3>Searching (Round Robin task)</h3>
			Searching task moves randomly to seek for Mouse without timing concern. It’s therefore best suited as a 
			background Round Robin task that executes whenever no other tasks of higher priority are executing. 			<br><br>
			<h3>Chasing (System task)</h3>
			Chasing chases Mouse by moving in the direction of Mouse until the Mouse is no longer detected or caught. 
			It must be executed quickly whenever Mouse is detected (an event) and for as long as Mouse is insight. Therefore, we 
			assign it as a system task. 
			<br><br>
			<h3>Rx (System task)</h3>
			Rx receives radio packets and must execute timely whenever a radio packet has arrived (an event). Thus, we 
			decide it should a system task.
			<br><br>
			<h3>Tx (System task)</h3>
			Tx transmits radio packets and must execute timely whenever there is a radio packet to be sent (an event). Thus, we 
			decide it should a system task.
			<br><br>
		</p>
		<p>
			<h3>Timing Diagram: Cat</h3>
			<img src="images/timing_diagram.jpg" alt="Timing Diagram: Cat" />	
			<br><br>					
		</p>
		<p>
			<h3>Mouse</h3>
			In our current design, Cat simply runs in the vacuum mode until time is up or caught by Cat. It’s much 
			less autonomous than Cat and therefore contains only three core tasks:
			<br><br>
			<h3>Time (System task)</h3>
			Time keeps track of time until a pre-determined time duration expired (an event). In which case, the Mouse has won. 
			It must be handled right away when the time expires but remains inactive otherwise. Therefore, a system task 
			is the most suitable.
			<br><br>					
			<h3>Rx (System task)</h3>
			Rx receives radio packets and must execute timely whenever a radio packet has arrived (an event). Thus, we 
			decide it should a system task.
			<br><br>
			<h3>Tx (System task)</h3>
			Tx transmits radio packets and must execute timely whenever there is a radio packet to be sent (an event). Thus, we 
			decide it should a system task.
			<br><br>
		</p>
	</div>
	<div id="colTwo">
		<h3>Project Sections</h3>
		<ul>
			<li class="first"><a href="01_game_rule.html">Game Rules</a></li>
			<li><a href="02_hardware_description.html">Hardware Description</a></li>
			<li><a href="03_design_process.html">Design Process</a></li>
			<li>-	<a href="03_a_block_diagram.html">Block Diagram</a></li>
			<li>-	<a href="03_b_msc.html">Message Sequence Charts</a></li>
			<li>-	<a href="03_c_fsm.html">Finite State Machines</a></li>
			<li>-	<a href="03_d_timing_diagram.html">Timing Diagrams</a></li>
			<li><a href="04_extra_features.html">Potential Extra Features</a></li>
		</ul>
	</div>
</div>
<div id="footer">
	<p>
		@ 2009. All Rights Reserved. Design by 
		<a href="http://www.freecsstemplates.org/">Free CSS Templates</a>.
	</p>
</div>
</body>
</html>
